<!--
 * @Descripttion: damage报损报溢新增
 * @version:
 * @Author: cxguo
 * @Date: 2019-08-17 20:26:23
 * @LastEditors: cxguo
 * @LastEditTime: 2019-11-20 10:21:38
 -->
<template>
  <div>
    <el-row :gutter="20">
      <el-col :span="12">
        <save-item ref="shopComp" :item-name="`门店`" />
      </el-col>
      <el-col :span="12">
        <save-item ref="storeComp" :item-name="`仓库`" />
      </el-col>
    </el-row>
  </div>
</template>
<script>
import { oftenuse } from '@/libs/mixins'
import SaveItem from './save-item'
export default {
  name: 'StoreSave',
  components: { SaveItem },
  mixins: [oftenuse],
  props: {
    operation: {
      type: String,
      default: null,
      validator: (value) => {
        return [].indexOf(value) !== -1
      }
    }
  },
  data() {
    return {
      shopObj: {},
      storeObj: {},
      optionsData: {},
      shopRules: {
        supplierId: [
          { required: true, message: '请选择供应商', trigger: 'blur' }
        ]
      }
    }
  },
  computed: {
  },
  watch: {
  },
  created() {
  },
  methods: {
    valiData() {
      const shopComp = this.$refs.shopComp
      const storeComp = this.$refs.storeComp
      const v1 = shopComp.handleValid('form')
      const v2 = storeComp.handleValid('form')
      return Promise.all([v1, v2])
    },
    getData() {
      const shop = this.$refs.shopComp.dataObj
      const store = this.$refs.storeComp.dataObj
      return { shop, store }
    }
  }
}
</script>

<style scoped>
</style>
